package main

import (
	"flag"
	"log"
	"net/http"
	"os"

	"gitee.com/runner.mei/tsproxy"
)

func main() {
	var influxURL string
	var moURL string
	var listenAddr string

	flag.StringVar(&influxURL, "influx", "", "")
	flag.StringVar(&moURL, "mo", "", "")
	flag.StringVar(&listenAddr, "listen", ":5050", "")
	flag.Parse()

	err := tsproxy.Run(listenAddr, moURL, influxURL)
	if err != nil {
		if err != http.ErrServerClosed {
			log.Println(err)
			os.Exit(-1)
		}
	}
}
